﻿using System.Collections;
using System.Collections.Generic;
using GameFramework.Fsm;
using UnityEngine;

namespace StarForce {
    public class CardDiscardState : BasicCardState
    {
        public CardDiscardState(Card handler, UiCardParameters parameters) : base(handler, parameters) {
        }

        protected override void OnEnter(IFsm<Card> fsm) {
            base.OnEnter(fsm);
            Disable();
            SetScale();
            SetRotation();
        }

        private void SetScale() {
            Vector3 finalScale = Hander.transform.localScale * Parameters.DiscardedSize;
            Hander.ScaleTo(finalScale,Parameters.ScaleSpeed);
        }

        private void SetRotation() {
            float speed = Parameters.RotationSpeed;
            Hander.RotateTo(Vector3.zero,speed);
        }
    }
}
